<?php
class ProductController extends Nguyen_Controller_Action{
	public function init(){
		$this->loadTemplate('default');
		$model = new Administrator_Model_News_View();
		$info = $model->GetSiteInfo();
		$this->view->headMeta()->appendName('keywords', $info['meta']);
        $this->view->headMeta()->appendName('description', $info['description']);
        $this->view->headTitle($info['sitename'],true);
	}
	public function indexAction(){ 
		$model = new Administrator_Model_System();
	}
	public function detailsAction(){ 
		$model = new Administrator_Model_Product_View();
		$siteinfo = $model->GetSiteInfo();
		$id = $this->_request->getParam('proid','');
		$this->view->id = $id;
		$info = $model->GetProductInfo($id);
		$this->view->headTitle($siteinfo['sitename'].' | '.$info['name'],true);
	}
	public function catalogueAction(){ 
		$model = new Administrator_Model_Product_View();
		$siteinfo = $model->GetSiteInfo();
		$id = $this->_request->getParam('catid','');
		$page = $this->_request->getParam('page','1');
		$psize = $this->_request->getParam('psize','15');
		$this->view->id = $id;
		$this->view->page = $page;
		$this->view->psize = $psize;
		$info = $model->GetPro_catInfo($id);
		$this->view->headTitle($siteinfo['sitename'].' | '.$info['name'],true);
	}
	public function typeAction(){ 
		$model = new Administrator_Model_Product_View();
		$siteinfo = $model->GetSiteInfo();
		$id = $this->_request->getParam('typeid','');
		$page = $this->_request->getParam('page','1');
		$psize = $this->_request->getParam('psize','15');
		$this->view->id = $id;
		$this->view->page = $page;
		$this->view->psize = $psize;
		$info = $model->GetProduct_type($id);
		$this->view->headTitle($siteinfo['sitename'].' | '.$info['name'],true);
	}
}